package com.lagou.edu.mvcframework.demo.controller;

import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouConroller;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.LagouSecurity;
import com.lagou.edu.mvcframework.demo.service.DemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@LagouConroller
@LagouRequestMapping("/demo")
@LagouSecurity(userName = {"zhangsan","lisi"})
public class DemoController {

    @LagouAutowired
    private DemoService demoService;

    @LagouRequestMapping("/query")
    public String query(HttpServletRequest req,HttpServletResponse res,String name){
        return  demoService.testMvc(name);
    }

    @LagouRequestMapping("/query2")
    @LagouSecurity(userName = {"wangwu"})
    public String query2(HttpServletRequest req,HttpServletResponse res,String name){
        return  demoService.testMvc(name);
    }

}
